package com.ecds.monitor;

import java.util.ResourceBundle;
import java.util.Timer;

public class MainServer {
	public static ResourceBundle rb;
	public static final long afterTime = 1000;// 在1秒后执行此任务
	public static long everyTime = 1000*60*5; //每次执行间隔时间
	
	public static void main(String[] args){
		rb = ResourceBundle.getBundle("system");
		everyTime = Long.parseLong(rb.getString("monitoring.everytime"));
        Timer timer = new Timer();
        timer.schedule(new MyTask(), afterTime, everyTime);//如果传递一个Data参数,就可以在某个固定的时间执行这个任务.
	}
	
	static class MyTask extends java.util.TimerTask{
        @Override
        public void run() {
        	Web.checkHtml();
        	if("true".equals(rb.getString("monitoring.syncfile.check"))){
        		CacheServer.monitorSyncfile();
        	}else{
        		ConnectDBTest.getConn();
        	}
        }
    } 
}
